package com.zblog.yuhang.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zblog.yuhang.domain.Blog;
import com.zblog.yuhang.repository.BlogRepository;

@Service
public class BlogServiceImpl implements BlogService {

	@Autowired
	private BlogRepository blogRepository;
	
	@Override
	public List<Blog> getAllBlog() {
		return blogRepository.findAll();
	}

	@Override
	public Blog getBlogById(Long id) {
		return blogRepository.findOne(id);
	}

}
